home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / gtkembedmoz / gtkmozembed.h < prev   
C/C++ Source or Header  |  2006-05-08  |  11KB  |  272 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is mozilla.org code.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Christopher Blizzard. Portions created by Christopher Blizzard are Copyright (C) Christopher Blizzard.  All Rights Reserved.
  18.  * Portions created by the Initial Developer are Copyright (C) 2001
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *   Christopher Blizzard <blizzard@mozilla.org>
  23.  *   Ramiro Estrugo <ramiro@eazel.com>
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #ifndef gtkmozembed_h
  40. #define gtkmozembed_h
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif /* __cplusplus */
  45.  
  46. #include <stddef.h>
  47. #include <gtk/gtk.h>
  48. #ifdef MOZILLA_CLIENT
  49. #include "nscore.h"
  50. #ifdef _IMPL_GTKMOZEMBED
  51. #define GTKMOZEMBED_API(type) NS_EXPORT_(type)
  52. #else
  53. #define GTKMOZEMBED_API(type) NS_IMPORT_(type)
  54. #endif
  55. #else
  56. #define GTKMOZEMBED_API(type) type
  57. #endif
  58.  
  59. #define GTK_TYPE_MOZ_EMBED             (gtk_moz_embed_get_type())
  60. #define GTK_MOZ_EMBED(obj)             GTK_CHECK_CAST((obj), GTK_TYPE_MOZ_EMBED, GtkMozEmbed)
  61. #define GTK_MOZ_EMBED_CLASS(klass)     GTK_CHECK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED, GtkMozEmbedClass)
  62. #define GTK_IS_MOZ_EMBED(obj)          GTK_CHECK_TYPE((obj), GTK_TYPE_MOZ_EMBED)
  63. #define GTK_IS_MOZ_EMBED_CLASS(klass)  GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
  64.  
  65. typedef struct _GtkMozEmbed      GtkMozEmbed;
  66. typedef struct _GtkMozEmbedClass GtkMozEmbedClass;
  67.  
  68. struct _GtkMozEmbed
  69. {
  70.   GtkBin    bin;
  71.   void     *data;
  72. };
  73.  
  74. struct _GtkMozEmbedClass
  75. {
  76.   GtkBinClass parent_class;
  77.  
  78.   void (* link_message)        (GtkMozEmbed *embed);
  79.   void (* js_status)           (GtkMozEmbed *embed);
  80.   void (* location)            (GtkMozEmbed *embed);
  81.   void (* title)               (GtkMozEmbed *embed);
  82.   void (* progress)            (GtkMozEmbed *embed, gint curprogress,
  83.                 gint maxprogress);
  84.   void (* progress_all)        (GtkMozEmbed *embed, const char *aURI,
  85.                 gint curprogress, gint maxprogress);
  86.   void (* net_state)           (GtkMozEmbed *embed, gint state, guint status);
  87.   void (* net_state_all)       (GtkMozEmbed *embed, const char *aURI,
  88.                 gint state, guint status);
  89.   void (* net_start)           (GtkMozEmbed *embed);
  90.   void (* net_stop)            (GtkMozEmbed *embed);
  91.   void (* new_window)          (GtkMozEmbed *embed, GtkMozEmbed **newEmbed,
  92.                 guint chromemask);
  93.   void (* visibility)          (GtkMozEmbed *embed, gboolean visibility);
  94.   void (* destroy_brsr)        (GtkMozEmbed *embed);
  95.   gint (* open_uri)            (GtkMozEmbed *embed, const char *aURI);
  96.   void (* size_to)             (GtkMozEmbed *embed, gint width, gint height);
  97.   gint (* dom_key_down)        (GtkMozEmbed *embed, gpointer dom_event);
  98.   gint (* dom_key_press)       (GtkMozEmbed *embed, gpointer dom_event);
  99.   gint (* dom_key_up)          (GtkMozEmbed *embed, gpointer dom_event);
  100.   gint (* dom_mouse_down)      (GtkMozEmbed *embed, gpointer dom_event);
  101.   gint (* dom_mouse_up)        (GtkMozEmbed *embed, gpointer dom_event);
  102.   gint (* dom_mouse_click)     (GtkMozEmbed *embed, gpointer dom_event);
  103.   gint (* dom_mouse_dbl_click) (GtkMozEmbed *embed, gpointer dom_event);
  104.   gint (* dom_mouse_over)      (GtkMozEmbed *embed, gpointer dom_event);
  105.   gint (* dom_mouse_out)       (GtkMozEmbed *embed, gpointer dom_event);
  106.   void (* security_change)     (GtkMozEmbed *embed, gpointer request,
  107.                 guint state);
  108.   void (* status_change)       (GtkMozEmbed *embed, gpointer request,
  109.                 gint status, gpointer message);
  110.   gint (* dom_activate)        (GtkMozEmbed *embed, gpointer dom_event);
  111.   gint (* dom_focus_in)        (GtkMozEmbed *embed, gpointer dom_event);
  112.   gint (* dom_focus_out)       (GtkMozEmbed *embed, gpointer dom_event);
  113. };
  114.  
  115. GTKMOZEMBED_API(GtkType)    gtk_moz_embed_get_type         (void);
  116. GTKMOZEMBED_API(GtkWidget*) gtk_moz_embed_new              (void);
  117. GTKMOZEMBED_API(void)       gtk_moz_embed_push_startup     (void);
  118. GTKMOZEMBED_API(void)       gtk_moz_embed_pop_startup      (void);
  119. GTKMOZEMBED_API(void)       gtk_moz_embed_set_comp_path    (const char *aPath);
  120. GTKMOZEMBED_API(void)       gtk_moz_embed_set_profile_path (const char *aDir,
  121.                                 const char *aName);
  122. GTKMOZEMBED_API(void)       gtk_moz_embed_load_url         (GtkMozEmbed *embed,
  123.                                 const char *url);
  124. GTKMOZEMBED_API(void)      gtk_moz_embed_stop_load        (GtkMozEmbed *embed);
  125. GTKMOZEMBED_API(gboolean)  gtk_moz_embed_can_go_back      (GtkMozEmbed *embed);
  126. GTKMOZEMBED_API(gboolean)  gtk_moz_embed_can_go_forward   (GtkMozEmbed *embed);
  127. GTKMOZEMBED_API(void)      gtk_moz_embed_go_back          (GtkMozEmbed *embed);
  128. GTKMOZEMBED_API(void)      gtk_moz_embed_go_forward       (GtkMozEmbed *embed);
  129. GTKMOZEMBED_API(void)   gtk_moz_embed_render_data      (GtkMozEmbed *embed, 
  130.                             const char *data,
  131.                             guint32 len,
  132.                             const char *base_uri, 
  133.                             const char *mime_type);
  134. GTKMOZEMBED_API(void)   gtk_moz_embed_open_stream      (GtkMozEmbed *embed,
  135.                             const char *base_uri,
  136.                             const char *mime_type);
  137. GTKMOZEMBED_API(void)   gtk_moz_embed_append_data      (GtkMozEmbed *embed,
  138.                             const char *data,
  139.                             guint32 len);
  140. GTKMOZEMBED_API(void)   gtk_moz_embed_close_stream     (GtkMozEmbed *embed);
  141. GTKMOZEMBED_API(char*)  gtk_moz_embed_get_link_message (GtkMozEmbed *embed);
  142. GTKMOZEMBED_API(char*)  gtk_moz_embed_get_js_status    (GtkMozEmbed *embed);
  143. GTKMOZEMBED_API(char*)  gtk_moz_embed_get_title        (GtkMozEmbed *embed);
  144. GTKMOZEMBED_API(char*)  gtk_moz_embed_get_location     (GtkMozEmbed *embed);
  145. GTKMOZEMBED_API(void)   gtk_moz_embed_reload           (GtkMozEmbed *embed,
  146.                             gint32 flags);
  147. GTKMOZEMBED_API(void)   gtk_moz_embed_set_chrome_mask  (GtkMozEmbed *embed, 
  148.                             guint32 flags);
  149. GTKMOZEMBED_API(guint32) gtk_moz_embed_get_chrome_mask (GtkMozEmbed *embed);
  150.  
  151. /* enum types */
  152. #define GTK_TYPE_MOZ_EMBED_PROGRESS_FLAGS \
  153.              (gtk_moz_embed_progress_flags_get_type())
  154. #define GTK_TYPE_MOZ_EMBED_STATUS_ENUMS \
  155.              (gtk_moz_embed_status_enums_get_type())
  156. #define GTK_TYPE_MOZ_EMBED_RELOAD_FLAGS \
  157.              (gtk_moz_embed_reload_flags_get_type())
  158. #define GTK_TYPE_MOZ_EMBED_CHROME_FLAGS \
  159.              (gtk_moz_embed_chrome_flags_get_type())
  160.  
  161. GTKMOZEMBED_API(GtkType)      gtk_moz_embed_progress_flags_get_type (void);
  162. GTKMOZEMBED_API(GtkType)      gtk_moz_embed_status_enums_get_type (void);
  163. GTKMOZEMBED_API(GtkType)      gtk_moz_embed_reload_flags_get_type (void);
  164. GTKMOZEMBED_API(GtkType)      gtk_moz_embed_chrome_flags_get_type (void);
  165.  
  166. /* These are straight out of nsIWebProgressListener.h */
  167.  
  168. typedef enum
  169. {
  170.   GTK_MOZ_EMBED_FLAG_START = 1,
  171.   GTK_MOZ_EMBED_FLAG_REDIRECTING = 2,
  172.   GTK_MOZ_EMBED_FLAG_TRANSFERRING = 4,
  173.   GTK_MOZ_EMBED_FLAG_NEGOTIATING = 8,
  174.   GTK_MOZ_EMBED_FLAG_STOP = 16,
  175.   
  176.   GTK_MOZ_EMBED_FLAG_IS_REQUEST = 65536,
  177.   GTK_MOZ_EMBED_FLAG_IS_DOCUMENT = 131072,
  178.   GTK_MOZ_EMBED_FLAG_IS_NETWORK = 262144,
  179.   GTK_MOZ_EMBED_FLAG_IS_WINDOW = 524288,
  180.  
  181.   GTK_MOZ_EMBED_FLAG_RESTORING = 16777216
  182. } GtkMozEmbedProgressFlags;
  183.  
  184. /* These are from various networking headers */
  185.  
  186. typedef enum
  187. {
  188.   /* NS_ERROR_UNKNOWN_HOST */
  189.   GTK_MOZ_EMBED_STATUS_FAILED_DNS     = 2152398878U,
  190.  /* NS_ERROR_CONNECTION_REFUSED */
  191.   GTK_MOZ_EMBED_STATUS_FAILED_CONNECT = 2152398861U,
  192.  /* NS_ERROR_NET_TIMEOUT */
  193.   GTK_MOZ_EMBED_STATUS_FAILED_TIMEOUT = 2152398862U,
  194.  /* NS_BINDING_ABORTED */
  195.   GTK_MOZ_EMBED_STATUS_FAILED_USERCANCELED = 2152398850U
  196. } GtkMozEmbedStatusFlags;
  197.  
  198. /* These used to be straight out of nsIWebNavigation.h until the API
  199.    changed.  Now there's a mapping table that maps these values to the
  200.    internal values. */
  201.  
  202. typedef enum 
  203. {
  204.   GTK_MOZ_EMBED_FLAG_RELOADNORMAL = 0,
  205.   GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE = 1,
  206.   GTK_MOZ_EMBED_FLAG_RELOADBYPASSPROXY = 2,
  207.   GTK_MOZ_EMBED_FLAG_RELOADBYPASSPROXYANDCACHE = 3,
  208.   GTK_MOZ_EMBED_FLAG_RELOADCHARSETCHANGE = 4
  209. } GtkMozEmbedReloadFlags;
  210.  
  211. /* These are straight out of nsIWebBrowserChrome.h */
  212.  
  213. typedef enum
  214. {
  215.   GTK_MOZ_EMBED_FLAG_DEFAULTCHROME = 1U,
  216.   GTK_MOZ_EMBED_FLAG_WINDOWBORDERSON = 2U,
  217.   GTK_MOZ_EMBED_FLAG_WINDOWCLOSEON = 4U,
  218.   GTK_MOZ_EMBED_FLAG_WINDOWRESIZEON = 8U,
  219.   GTK_MOZ_EMBED_FLAG_MENUBARON = 16U,
  220.   GTK_MOZ_EMBED_FLAG_TOOLBARON = 32U,
  221.   GTK_MOZ_EMBED_FLAG_LOCATIONBARON = 64U,
  222.   GTK_MOZ_EMBED_FLAG_STATUSBARON = 128U,
  223.   GTK_MOZ_EMBED_FLAG_PERSONALTOOLBARON = 256U,
  224.   GTK_MOZ_EMBED_FLAG_SCROLLBARSON = 512U,
  225.   GTK_MOZ_EMBED_FLAG_TITLEBARON = 1024U,
  226.   GTK_MOZ_EMBED_FLAG_EXTRACHROMEON = 2048U,
  227.   GTK_MOZ_EMBED_FLAG_ALLCHROME = 4094U,
  228.   GTK_MOZ_EMBED_FLAG_WINDOWRAISED = 33554432U,
  229.   GTK_MOZ_EMBED_FLAG_WINDOWLOWERED = 67108864U,
  230.   GTK_MOZ_EMBED_FLAG_CENTERSCREEN = 134217728U,
  231.   GTK_MOZ_EMBED_FLAG_DEPENDENT = 268435456U,
  232.   GTK_MOZ_EMBED_FLAG_MODAL = 536870912U,
  233.   GTK_MOZ_EMBED_FLAG_OPENASDIALOG = 1073741824U,
  234.   GTK_MOZ_EMBED_FLAG_OPENASCHROME = 2147483648U 
  235. } GtkMozEmbedChromeFlags;
  236.  
  237. /* this is a singleton object that you can hook up to to get signals
  238.    that are not handed out on a per widget basis. */
  239.  
  240. #define GTK_TYPE_MOZ_EMBED_SINGLE            (gtk_moz_embed_single_get_type())
  241. #define GTK_MOZ_EMBED_SINGLE(obj)            GTK_CHECK_CAST((obj), GTK_TYPE_MOZ_EMBED_SINGLE, GtkMozEmbedSingle)
  242. #define GTK_MOZ_EMBED_SINGLE_CLASS(klass)    GTK_CHEK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED_SINGLE, GtkMozEmbedSingleClass)
  243. #define GTK_IS_MOZ_EMBED_SINGLE(obj)         GTK_CHECK_TYPE((obj), GTK_TYPE_MOZ_EMBED_SINGLE)
  244. #define GTK_IS_MOZ_EMBED_SINGLE_CLASS(klass) GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
  245.  
  246. typedef struct _GtkMozEmbedSingle      GtkMozEmbedSingle;
  247. typedef struct _GtkMozEmbedSingleClass GtkMozEmbedSingleClass;
  248.  
  249. struct _GtkMozEmbedSingle
  250. {
  251.   GtkObject  object;
  252.   void      *data;
  253. };
  254.  
  255. struct _GtkMozEmbedSingleClass
  256. {
  257.   GtkObjectClass parent_class;
  258.  
  259.   void (* new_window_orphan)   (GtkMozEmbedSingle *embed,
  260.                 GtkMozEmbed **newEmbed,
  261.                 guint chromemask);
  262. };
  263.  
  264. GTKMOZEMBED_API(GtkType)             gtk_moz_embed_single_get_type  (void);
  265. GTKMOZEMBED_API(GtkMozEmbedSingle *) gtk_moz_embed_single_get       (void);
  266.  
  267. #ifdef __cplusplus
  268. }
  269. #endif /* __cplusplus */
  270.  
  271. #endif /* gtkmozembed_h */
  272.